
//$CC main.c check_state.c config_qn.c cycle_task.c ui_task.c -o ectest_mc -L ./include -lethercat -lpthread
//$CC main.c check_state.c config_qn.c cycle_task.c ui_task.c -o ectest_mc -L ./include -lethercat -lpthread "-fno-stack-protector"
//scp ectest_mc root@192.168.58.1:/home/mc

#include <pthread.h>
#include "include/check_state.h"
#include "include/config_qn.h"
#include "include/cycle_task.h"
#include "include/ui_task.h"

pthread_t id;        //unsigned long int
int i,rets;

int main(void)
{
    
    //config_PDO();
    
    config_pp_mode();
    /***********************************/
    rets=pthread_create(&id,NULL,(int *)data_cycle_task,NULL); 
    if (rets < 0) {
        fprintf(stderr, "xenomai Failed to create task: %s\n", strerror(-rets));
        return -1;
    }    
    int num = GetSlavesInfo(slaves, 16);
    printf("num = %d\n",num);  
   
    /*****************/
    pause();
    
    positon_control();
    
    
    printf("release_master\n");
    ecrt_release_master(master);
    
    return 0;
}

